<script setup>
  import {reactive, toRef, ref} from 'vue'

  
  let person = reactive({
    name: '张三',
    age: 22,
    score: 78
  });

  let refAge = toRef(person, 'age');

  let fun = function(){
    refAge.value++;
  }
</script>

<template>
  <div>
    <input type="button" v-bind:value="'age'"/>:{{ person.age }}
    <input type="button" v-bind:value="'refAge'" v-on:click="fun()"/>:{{ refAge }}
  </div>
</template>

<style scoped>
</style>
